<%@ page language="java" pageEncoding="utf-8" contentType="text/html; charset=utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
  <TITLE>管理中心登陆 </TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK href="resource/css/admin.css" type="text/css" rel="stylesheet">
    <script type="text/javascript" src="scripts/jquery-1.4.2.js"></script>
<script>
    var  basePath="<%=basePath%>";
    function  checklogin(){
	  String.prototype.trim=function(){
        return this.replace(/(^\s*)|(\s*$)/g, "");
      }
      var name=document.getElementById("name").value;
       var pass=document.getElementById("password").value;
      if(name.trim()==""){
          alert("请输入用户名");
          return false;
    	 }
        if(pass.trim()==""){
        alert("请输入密码");
        return false;	
        }
        var url1 = basePath+"adminloign/adminlogin.shtml";
               $.ajax({
                    url: url1,
                    cache: false,
                    data: "username="+encodeURIComponent(name)+"&password="+pass,
                    success: function(msg){
                      
                        var obj=eval('('+msg+')');
                        var result=obj[0]["message"];
                       
                      if(result=="0"){
                         alert("用户名或密码输入错误");
                         return  false;
                      }
                      if(result=="1"){
                         //alert("登录成功");
                         window.location.href=basePath+"back/jsp/index.htm";
                      }
                      
                 }
                });
        return  false;  
  }
  
</script>
</HEAD>
<BODY onload=document.myform.name.select();>
<TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%" bgColor=#002779 
border=0>
  <TR>
    <TD align="center">
      <TABLE cellSpacing=0 cellPadding=0 width=468 border=0>
        <TR>
          <TD><IMG height=23 src="resource/images/login_1.jpg" 
          width=468></TD></TR>
        <TR>
          <TD><IMG height=147 src="resource/images/login_2.jpg" 
            width=468></TD></TR></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=468 bgColor=#ffffff border=0>
        <TR>
          <TD width=16><IMG height=122 src="resource/images/login_3.jpg"  width=16>
           </TD>
          <TD align="center">
             <form name="myform" action="adminloign/adminlogin.shtml" method="post" onsubmit="return  checklogin()">
            <TABLE cellSpacing=0 cellPadding=0 width=230 border=0>
             
              <TR height=5>
                <TD width=5></TD>
                <TD width=56></TD>
                <TD></TD></TR>
              <TR height=36>
                <TD colSpan=3>
                   用户名&emsp;<INPUT onmouseover="select()" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" 
                  maxLength=30 size=24 id="name" name="name"></TD></TR>
              <TR height=36>
                <TD colSpan=3>口　令&emsp;<INPUT onmouseover="select()"
                  style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" 
                  type="password" id="password" maxLength=30 size=24  
                name="password" ></TD></TR>
              <TR height=5>
                <TD colSpan=3></TD></TR>
              <TR>
                <TD>&nbsp;</TD>
                <TD>&nbsp;</TD>
                <TD><INPUT type=image height=18 width=70 src="resource/images/bt_login.gif">
                 </TD></TR></TABLE></form></TD>
          <TD width=16><IMG height=122 src="resource/images/login_4.jpg" 
            width=16></TD></TR></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=468 border=0>
        <TR>
          <TD><IMG height=16 src="resource/images/login_5.jpg" 
          width=468></TD></TR></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=468 border=0>
        <TR>
          <TD align=right>
          </TD></TR></TABLE></TD></TR></TABLE></BODY></HTML>
